export function resultSuce(result = null, { code = 0, message = 'OK' } = {}) {
  return {
    code,
    message,
    result,
  }
}

export function resultErr(message = 'Request Failed', { code = -1, result = null } = {}) {
  return {
    code,
    message,
    result,
  }
}

export interface requestParams {
  method: string;
  body: any;
  headers?: { authorization?: string };
  query: any;
}

export function getRequestToken( {headers}:requestParams ): string | undefined {
  console.log(headers.authorization, 'headers');
  
  return headers?.authorization
}